# from django.db import models
#
# SWAP_MAKERS = [
#     ('玖行', '玖行'),
#     ('融青', '融青'),
#     ('智锂', '智锂'),
#     ('双杰', '双杰'),
#     ('三一', '三一'),
# ]
# SOFTWARE_VERSIONS = [
#     ('2', '玖行站控'),
#     ('7', '自研站控'),
# ]
# GROUP_IDS = [
#     ('cidLSNmQcBGApGfJ2fs7s/ZwA==', '事业一部'),
#     ('cid3tEqV2PxMArhN43tS4K5+w==', '事业二部'),
#     ('cidROVaJHQAgYcipeqZGaXUPQ==', '事业三部'),
#     ('cid1a02dNB/KB3epiHv8xR9GQ==', '事业四部'),
#     ('cidq+M7ADQGkt4r1g99QbJ/og==', '事业五部'),
#     ('cidRU9GZuy+Kun62rYjtTxV6w==', '事业六部'),
# ]
# BUSINESS_UNITS = [
#     ('事业一部', '事业一部'),
#     ('事业二部', '事业二部'),
#     ('事业三部', '事业三部'),
#     ('事业四部', '事业四部'),
#     ('事业五部', '事业五部'),
#     ('事业六部', '事业六部'),
# ]
# DRIVE_TYPES = [
#     ('inverter', '变频器驱动'),
#     ('servo', '伺服驱动'),
#     ('hydraulic', '液压驱动'),
# ]
# ROBOT_DIRECTIONS = [
#     ('vertical', '垂直'),
#     ('parallel', '平行'),
# ]
#
#
# # Create your models here.
# class StationType(models.Model):
#     swap_maker = models.CharField(max_length=10, choices=SWAP_MAKERS, verbose_name="换电站厂商")
#     station_model = models.CharField(primary_key=True, max_length=20, verbose_name="换电站型号")
#
#     class Meta:
#         db_table = "insight_SWAP_STATION_TYPE"
#         verbose_name = "换电站类型"
#
#
# class RobotType(models.Model):
#     swap_maker = models.CharField(max_length=10, choices=SWAP_MAKERS, verbose_name="换电站厂商")
#     robot_type = models.CharField(primary_key=True, max_length=20, verbose_name="换电机器人型号")
#
#     class Meta:
#         db_table = "insight_SWAP_ROBOT_TYPE"
#         verbose_name = "换电机器人型号"
#
#
# class Station(models.Model):
#     station_id = models.CharField(max_length=10, primary_key=True, unique=True, db_column='stationNo')
#     station_name = models.CharField(max_length=40, db_column='stationName')
#     business_unit = models.CharField(choices=BUSINESS_UNITS, max_length=10, db_column='businessUnit')
#     group_id = models.CharField(max_length=40, choices=GROUP_IDS, db_column='groupID')
#     station_maker = models.CharField(choices=SWAP_MAKERS, default='玖行', max_length=10, db_column='stationMaker')
#     station_type = models.ForeignKey(
#         StationType,
#         on_delete=models.CASCADE,
#         related_name='station',
#         verbose_name='所属换电站型号',
#         db_column='stationType',
#         default="四代站",
#     )
#     software_version = models.CharField(choices=SOFTWARE_VERSIONS, default='7', max_length=10,
#                                         db_column='softwareVersion')
#     robot_type = models.ForeignKey(
#         RobotType,
#         on_delete=models.CASCADE,
#         related_name="station",
#         verbose_name='所属换电机器人型号',
#         db_column="robotType",
#         default="玖行站力豪"
#     )
#     drive_type = models.CharField(max_length=10, choices=DRIVE_TYPES, db_column='driveType')
#     robot_direction = models.CharField(max_length=10, choices=ROBOT_DIRECTIONS, db_column='robotDirection')
#     motor_count = models.IntegerField(db_column="motorCount", verbose_name="电机数量")
#
#     class Meta:
#         db_table = "insight_swap_station"
#         verbose_name = "换电站列表"
#
#
# class SwapService(models.Model):
#     SWAP_MODES = [
#         (1, '全自动换电'),
#         (2, '半自动换电'),
#         (3, '人工干预'),
#         (4, '二维码换电')
#     ]
#     SWAP_TYPES = [
#         ('换电', '换电'),
#         ('换仓', '换仓'),
#     ]
#     station = models.ForeignKey(
#         Station,
#         on_delete=models.CASCADE,
#         related_name='station',
#         verbose_name="所属换电站",
#         db_column="stationNo",
#     )
#     order_sn = models.CharField(max_length=40, db_column="orderSn", primary_key=True, verbose_name="换电订单编号")
#     rfid_code = models.CharField(max_length=50, db_column="rfidCode", verbose_name="车辆RFID", null=True)
#     vin = models.CharField(max_length=20, db_column="vin", null=True, verbose_name="车辆vin码")
#     plate_number = models.CharField(max_length=20, db_column="plateNo", verbose_name="车牌号码", null=True)
#     start_time = models.DateTimeField(db_column="startTime", verbose_name="开始换电时间")
#     stop_time = models.DateTimeField(db_column="stopTime", verbose_name="完成换电时间")
#     summary_time = models.IntegerField(db_column="sumTimeSecond", verbose_name="换电时长")
#     swap_mode = models.IntegerField(db_column="swapMode", choices=SWAP_MODES, verbose_name="换电模式")
#     swap_type = models.CharField(max_length=10, db_column="swapType", choices=SWAP_TYPES, verbose_name="换电/换仓")
#
#     class Meta:
#         db_table = "insight_swap_service"
#         verbose_name = "换电服务"
#
#
# class PhysicalQuantity(models.Model):
#     quantity_name = models.CharField(max_length=20, primary_key=True,
#                                      db_column='quantityName', verbose_name="量纲名称")
#     quantity_description = models.CharField(max_length=45, db_column='quantityDesc', verbose_name='量纲描述')
#
#     class Meta:
#         db_table = "insight_PHISICAL_QUANTITY"
#         verbose_name = "物理量"
#
#
# class StatisticalMethod(models.Model):
#     method_name = models.CharField(max_length=20, primary_key=True,
#                                    db_column='methodName', verbose_name='方法名称')
#     method_description = models.CharField(max_length=45, db_column='methodDesc', verbose_name="方法描述")
#
#     class Meta:
#         db_table = "insight_STATISTICAL_METHOD"
#         verbose_name = "统计方法"
#
#
# class SwapServiceFeature(models.Model):
#     id = models.AutoField(primary_key=True, db_column="feature_id")
#     order_sn = models.ForeignKey(
#         SwapService,
#         on_delete=models.CASCADE,
#         related_name="order",
#         verbose_name="所属换电服务",
#         db_column="orderSn"
#     )
#     date = models.DateField(db_column="date", verbose_name="特征日期")
#     physical_quantity = models.ForeignKey(
#         PhysicalQuantity,
#         on_delete=models.CASCADE,
#         related_name="feature",
#         verbose_name="所属物理量",
#         db_column="physicalQuantity"
#     )
#     statistical_method = models.ForeignKey(
#         StatisticalMethod,
#         on_delete=models.CASCADE,
#         related_name="feature",
#         verbose_name="所属统计方法",
#         db_column="statisticalMethod"
#     )
#     feature_value = models.FloatField(verbose_name="特征值", db_column="featureValue")
#
#     class Meta:
#         db_table = "insight_swap_service_feature",
#         verbose_name = "换电机器人过程特征"
